# coding:utf-8
class Admin::RecommandHistoriesController < AdminController
	
  respond_to :html, :json

  set_tab :statistics
  set_tab :recommand_histories, :sub_nav
  before_filter :setup, only: [:index]

  def index
    @recommand_histories = RecommandHistory.order('created_at DESC')
	end

  def new
    @recommand_history = RecommandHistory.new
  end

  def edit
    @recommand_history = RecommandHistory.find params[:id]
  end

  def create
    @recommand_history = RecommandHistory.new(params[:recommand_history])
    render :action => :new unless @recommand_history.save
  end

  def update
    @recommand_history = RecommandHistory.find params[:id]
    render :action => :edit unless @recommand_history.update_attributes(params[:recommand_history])
  end

  def destroy
    @recommand_history = RecommandHistory.find params[:id]
    @recommand_history.destroy
  end

  private

  def setup
    @ways = ["业务","推荐历史记录"]
    @left_panel = "layouts/statistics_left_panel"
  end
end